--- a/include/znc/Csocket.h
+++ b/include/znc/Csocket.h
@@ -45,7 +45,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/time.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/file.h>
 
 #ifndef _WIN32
--- a/include/znc/FileUtils.h
+++ b/include/znc/FileUtils.h
@@ -22,7 +22,7 @@
 #include <dirent.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <vector>
--- a/src/Csocket.cpp
+++ b/src/Csocket.cpp
@@ -613,12 +613,8 @@
 	return( strerror( iErrno ) );
 #else
 	memset( pszBuff, '\0', uBuffLen );
-#if !defined( _GNU_SOURCE )
 	if( strerror_r( iErrno, pszBuff, uBuffLen ) == 0 )
 		return( pszBuff );
-#else
-	return( strerror_r( iErrno, pszBuff, uBuffLen ) );
-#endif /* (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined( _GNU_SOURCE ) */
 #endif /* defined( sgi ) || defined(__sun) || defined(_WIN32) || (defined(__NetBSD_Version__) && __NetBSD_Version__ < 4000000000) */
 	return( CS_UNKNOWN_ERROR );
 }
